package com.dream.classinfo;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

/**
 * Created by Administrator on 2017/9/5.
 */

public class MySingleRequestQueue {
    private static  MySingleRequestQueue myInstance;
    private static Context context;
    private RequestQueue requestQueue;

    public MySingleRequestQueue(Context context) {
        this.context = context;
        requestQueue=getRequestQueue();
    }

    public static synchronized MySingleRequestQueue getMyInstance(Context context){
        if (myInstance==null){
            myInstance=new MySingleRequestQueue(context);
        }
        return myInstance;
    };

    public RequestQueue getRequestQueue(){
        if (requestQueue==null){
            requestQueue=new Volley().newRequestQueue(context.getApplicationContext());
        }
        return requestQueue;
    }

}
